package com.rmkj.trade.match.core;

/**
 * Created by Administrator on 2019/1/8.
 */
public class Order {
	private String id;
	private int direction;
	private String owner;
	private String goodsSymbol;
	private String price;
	private double amount;
	private double originalAmount;
	private long time;

	public Order(int direction, String owner, String goodsSymbol, String price, double amount) {
		this.direction = direction;
		this.owner = owner;
		this.goodsSymbol = goodsSymbol;
		this.price = price;
		this.amount = amount;
		this.originalAmount = amount;
	}

	public String getId() {
		return id;
	}

	public int getDirection() {
		return direction;
	}

	public String getOwner() {
		return owner;
	}

	public String getGoodsSymbol() {
		return goodsSymbol;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public String getPrice() {
		return price;
	}

	public double getAmount() {
		return amount;
	}

	public double getOriginalAmount() {
		return originalAmount;
	}

	void update(double amount){
		this.amount = this.amount - amount;
	}

	void setId(String id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "Order{" +
				"id='" + id + '\'' +
				", direction=" + direction +
				", owner='" + owner + '\'' +
				", goodsSymbol='" + goodsSymbol + '\'' +
				", price='" + price + '\'' +
				", amount=" + amount +
				", originalAmount=" + originalAmount +
				", time=" + time +
				'}';
	}
}
